package com.xxgc.spring.controller;

import com.xxgc.spring.util.AESCrypt;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

//页面跳转控制器
@Controller
public class PageJumpController {

    /**
     * 注册页面
     * @param modelAndView
     * @return
     */
    @RequestMapping("/user/register")
    public ModelAndView toRegister(ModelAndView modelAndView){
        modelAndView.setViewName("register.jsp");
        //携带key跳转
        modelAndView.addObject("key", AESCrypt.KEY);
        return modelAndView;
    }
    //单文件上传页面
    @RequestMapping("/file/uploading")
    public String toUpdate(){
        //这个会不会有异常？
        Object name = "zhangsan";
        Integer number = (Integer)name;

        return "file/uploading.jsp";
    }

    //多文件上传页面
    @RequestMapping("/file/uploadings")
    public String toUpdates(){
        return "file/uploadings.jsp";
    }
    //跳转到登录页面
    @RequestMapping("/userRegister/userLogin")
    public String toUserLogin(){
        return "userlogin.jsp";
    }
}
